<template>
	<el-upload class="upload-demo" 
		action="" 
		ref="upload" 
		:auto-upload='false' 
		:on-change='changeUpload' 
		accept="image/jpeg,image/gif,image/png,image/bmp">
    	<div size="small" class="upload_btn">
    		<div style="height:40px"></div><i class="iconfont icon-jiahao"></i><p style="line-height:0">点击上传</p>
    	</div>
  	</el-upload>
</template>

<script>
	import config from '@/assets/js/config.js'
	export default {
		data(){
			return {
				updateImg:config.uploadImage,
				formData: new FormData(),
				fileList: []
			}
		},
		methods: {
			changeUpload(file, fileList){
				console.log(file,fileList);
				console.log(file.raw);
				var formData = new FormData();
				formData.append("files",file.raw);
				this.$require.post(config.uploadImage,formData).then(res=>{
					console.log(res);
				})
			}
	   }
	}
</script>

<style>
</style>